<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .outer {
            width: 500px;
            background-color: #ddd26c;
            border: 1px solid #000;
            padding: 20px;
            /* margin: 0 auto; */
        }

        .box {
            width: 200px;
            height: 200px;
            font-size: 22px;
        }

        .box1 {
            background-color: #e97f7f;
        }

        .box2 {
            background-color: #e97fe6;
            position: relative;
            top: -150px;
            left: 50px;
            z-index: 1;
        }

        .box3 {
            background-color: #7fdbe9;
            position: absolute;
            top: 130px;
            left: 130px;
            z-index: 1;
        }

        .box4 {
            background-color: #7fe98b;
            position: fixed;
            top: 180px;
            left: 180px;
            z-index: 1;
        }
    </style>
</head>

<body>
    <div class="outer">
        <div class="box box1">1</div>
        <div class="box box2">2</div>
        <div class="box box3">3</div>
        <div class="box box4">4</div>
    </div>
</body>

</html>